Ubuntu (Linux) Neo4j

您所在的位置:网站首页 neo4j 社区版 企业版 性能 Ubuntu (Linux) Neo4j

Ubuntu (Linux) Neo4j

2023-06-03 18:17| 来源: 网络整理| 查看: 265

title

Author: Hua Zhouqi, Department of Computer Science & Technology, Tongji University

System versionUbuntu 23.04Virtual machine versionVMware Workstation 17Neo4j versionNeo4j-5.6

Reference: github https://github.com/neo4j/neo4j

Download source code

Download zip file from https://github.com/neo4j/neo4j and decompress into \home\(username)\neo4j-5.6 or find other folder list to store.

desktop

Download dependent files

Since the construction of neo4j relies on Apache Maven (project management and synthesis tool) , it’s necessary to prepare the dependent environment before running the source code.

Maven

Based on the concept of the Project Object Model (POM) , Maven can manage project builds, reports, and files from a central slice. POM will be mentioned In subsequent problems.

Learn more about Apache Maven: https://maven.apache.org/ or zhuanlan.zhihu.com/p/327818426

Open the terminal directly in Ubuntu (using Ctrl+Alt+t) and enter the following command:

sudo apt install maven openjdk-17-jdk

Neo4J is developed using the Java environment, so the version corresponding to the JDK is downloaded at the same time.

Build Neo4j project

According to the installation guide on GitHub, it’s necessary to test the limit on the number of open files before building the project.

Choose build project after test or skip the test outright.

Test

The test only requires a single line of code in the terminal:

ulimit -n Skip Test

Run the following code to skip the test and directly get jars:

mvn clean install -DskipTests -T1C

There a list of problem may occur: (or fortunately not happen)

no POM in this directory

no pom in dic

The reason for this error is that there is no pom.xml file in the current directory, and the Maven execution must pom.xml file, which means that it needs to be run in the pom.xml file directory of the project.

Since the full source code is downloaded, there is no problem with missing pom.xml files. So just locate the terminal operation location there using order cd xxx.

cd xxx

POM

POM is one of the core concepts in the Apache Maven project, which is an abbreviation for Project Object Model. POM is an XML file that describes the basic information of a Maven project, including project dependencies, plugins, version numbers, developer information, build configurations, etc.

The role of POM includes:

Defines the basic information and structure of the project, including the project name, version number, author, license, and so on.Manage project dependencies, define all dependent libraries and version numbers, and implement specific functions by configuring dependent libraries.Describes the build process of the project, including how to compile, test, package, and so on.Various plugins are configured, such as code inspection, unit testing, publishing, and so on. pom.xml java.lang.IllegalStateException

error

The cause of the problem is that the Java version and the Maven version do not match. Updating the Java version solves the problem.

在这里插入图片描述 (Thanks to senior Zhu Tongtong helps find the solution)

It takes a long time to run correctly :

correct

BUILD SUCCESS Takes me 42min 32s (no matter, I write this document during this period😀) .

Then use the following command to increase the amount of memory available to Maven:

export MAVEN_OPTS="-Xmx2048m" Run the project

All the preparation is complete! And now it’s time to run the project code.

First, enter the following directories and extract the corresponding version of the package (unzip and put everything in a directory): cd packaing/standalone/target

lic

Start the program with the following command from this directory terminal:

bin/neo4j start

or

bin/neo4j-admin start

Note that the Ubutunu system can only extract files in .tar archive, otherwise the command cannot be found.

The result of a successful run in the terminal:

oict

-----END-----


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3